package com.kly.enums;

public enum ProductCategory {
    ISNULL(0, "无效code"),

    MEMBER(1,"会员"),

    FLASH_CHAT(2, "直接会话"),

    PRIVATE_PHOTO(3, "私密相册"),

    PRIVATE_VIDEO(4, "私密视频"),

    NEW_USER_BENEFITS(5, "新用户权益"),

    OLD_USER_BENEFITS(6, "老用户权益"),

    USER_DISCOUNT(7, "用户促销"),

    USER_BACK_DISCOUNT(8, "召回促销"),

    OLD_USER_REGISTER(9, "用户注销后，重新注册时的权益"),

    SURPRISE_EASTER_EGG(10, "新手惊喜礼包"),

    IOS_MEBOO(11, "IOS 产品配置"),

    PP_ORGANIC_BENEFIT_FOR_NEW_USER(12, "PP包自然流量新用户权益"),

    PP_ORGANIC_BENEFIT_FOR_OLD_USER(13, "PP包自然流量老用户权益"),
    ;
    private int code;

    private String describe;

    ProductCategory(int code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public static ProductCategory fromType(int code) {
        if (code == 0) {
            return ISNULL;
        }
        for (ProductCategory productCategory : values()) {
            if (productCategory.getCode() == code) {
                return productCategory;
            }
        }
        return ISNULL;
    }

}
